package com.tc.juc.pack07;

import lombok.extern.slf4j.Slf4j;
import sun.misc.VM;

import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 * @Auther: tianchao
 * @Date: 2021/10/7 02:02
 * @Description:
 */
@Slf4j
public class Test1 {
    public static void main(String[] args) {
        Integer i1 = new Integer(1);
        Integer i2 = Integer.valueOf(1);
        Integer i3 = Integer.valueOf(1);
        System.out.println(i1==i2);
        System.out.println(i2==i3);
        String savedProperty = VM.getSavedProperty("java.lang.Integer.IntegerCache.high");
        System.out.println(savedProperty);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        for (int i = 0; i < 10; i++) {
            new Thread(()->{
                synchronized (simpleDateFormat){
                    try {
                        log.info("{}",simpleDateFormat.parse("1951-04-21"));
                    } catch (ParseException e) {
                        e.printStackTrace();
                    }
                }

            }).start();
        }
    }
}
